package org.pewpew.model;

import com.google.gson.Gson;

public class Command {
	private String action;
	private String object;

	public Command() {
	}

	public Command(String action) {
		this.action = action;
	}

	public Command(String action, String username) {
		this.action = action;
		this.object = username;
	}

	//@JSON
	public void setAction(String action) {
		this.action = action;
	}

	//@JSON
	public String getAction() {
		return action;
	}

	public String toJSON() {
		//return new JSONSerializer().serialize(this);
		return new Gson ().toJson(this);
	}

	public static Command fromJSON(String jsonString) {
		//return new JSONDeserializer<Command>().deserialize(jsonString);
		return new Gson().fromJson(jsonString, Command.class);
	}

	public String getObject() {
		return object;
	}
}
